package org.example.eight3.util;

import org.mindrot.jbcrypt.BCrypt;

public class BCryptUtil {
    /**
     * 加密方法
     * @param password
     * @return
     */
    public static String encrypt(String password){
        return BCrypt.hashpw(password, BCrypt.gensalt(12));
    }

    public static boolean varify(String plaintext, String hashed){
        return BCrypt.checkpw(plaintext, hashed);
    }
}
